# Copyright 2018- The Pixie Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

load("//bazel:pl_build_system.bzl", "pl_cc_library", "pl_cc_test", "pl_cc_test_library")

package(default_visibility = ["//src/carnot:__subpackages__"])

pl_cc_library(
    name = "cc_library",
    srcs = glob(
        [
            "*.cc",
            "*.h",
        ],
        exclude = [
            "**/*_test.cc",
            "**/test_utils.h",
        ],
    ),
    hdrs = ["qlobject.h"],
    deps = [
        "//src/carnot/planner/ast:cc_library",
        "//src/carnot/planner/ir:cc_library",
        "//src/carnot/planner/parser:cc_library",
        "//src/shared/types/typespb/wrapper:cc_library",
        "@com_github_opentelemetry_proto//:trace_proto_cc",
        "@com_github_vinzenz_libpypa//:libpypa",
    ],
)

pl_cc_test_library(
    name = "test_utils",
    hdrs = ["test_utils.h"],
    deps = [
        ":cc_library",
        "//src/carnot/planner/compiler:cc_library",
        "//src/carnot/planner/compiler:test_utils",
    ],
)

pl_cc_test(
    name = "ql_object_test",
    srcs = ["ql_object_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "funcobject_test",
    srcs = ["funcobject_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "exporter_test",
    srcs = ["exporter_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "otel_test",
    srcs = ["otel_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "dataframe_test",
    srcs = ["dataframe_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "none_object_test",
    srcs = ["none_object_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "type_object_test",
    srcs = ["type_object_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "pixie_module_test",
    srcs = ["pixie_module_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "metadata_object_test",
    srcs = ["metadata_object_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "default_arguments_test",
    srcs = ["default_arguments_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "viz_object_test",
    srcs = ["viz_object_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "collection_object_test",
    srcs = ["collection_object_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "module_test",
    srcs = ["module_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "var_table_test",
    srcs = ["var_table_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)

pl_cc_test(
    name = "plugin_module_test",
    srcs = ["plugin_test.cc"],
    deps = [
        ":cc_library",
        ":test_utils",
    ],
)
